<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<title>飞腾会-FitaClub</title>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
</head>
<!-- end header -->

<body>
  <div class="page-group">
    <div class="page page-current bg-light-gray coupon-list-page">
      <header class="bar bar-nav fita-header">
        <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
        <a class="icon icon-menu pull-right open-panel"></a>
        <h1 class="title">我的优惠券</h1>
      </header>
      
      <div class="content" >
        <div class="buttons-tab fixed-tab fita-buttons-tab" style="margin-top: .5rem;" data-offset="60">
          <a href="${ctx.host}/coupon/unuse" class="active button">可使用</a>
          <a href="${ctx.host}/coupon/used" class="button">已过期/已使用</a>
        </div>
        
        <div class="list-block coupon-list">
		      <c:forEach items="${coupons}" var = "coupon">
  		      <div class="item">
		      	
		          <div class="row no-gutter text-center">
		            <div class="col-60" style="width: 59%;">
		              <div class="price-box">￥<span class="price">${coupon.amount/100}</span></div>
		              <div class="tip"><span>优惠券</span></div>
		            </div>
		            <div class="col-40">
		              <div class="coupon-title">租车预付专享</div>
		              <div class="text-center" style="padding: .35rem 0;font-size: .8rem; font-weight: bold;">满${coupon.template.minAmount/100} 元使用</div>
		              <div class="coupon-time"><span>有效期至：<fmt:formatDate value="${coupon.effectiveEndDate}" pattern="yyyy/MM/dd" /></span></div>
		            </div>
		          </div>
		        </div>
		      </c:forEach>
        </div>
      </div>
    </div>
  </div>
  
  <div class="panel-overlay"></div>
    <div class="panel panel-right panel-cover fita-panel">
      <div class="list-block contacts-block no-margin">
        <p class="menu-title close-panel">关闭</p>
	      <ul>
	        <li>
	          <a href="${ctx.host}/cars/search" class="item-content item-link">
	            <div class="item-inner">
	              <div class="item-title">立即租车</div>
	            </div>
	          </a>
	        </li>
	        <li>
	          <a href="${ctx.host}/profile" class="item-content item-link">
	            <div class="item-inner">
	              <div class="item-title">个人中心</div>
	            </div>
	          </a>
	        </li>
	      </ul>
      </div>
    </div>
  </div>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/shopping/user-info.js" />
  <script type="text/javascript">
    require(['page/shopping/user-info'], function(page) {
      page.init()
    })
  </script>
  
</body>
</html>